package com.blacktech.dbu.meta.repository;

import com.blacktech.dbu.meta.entity.DbuDictionaryItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 数据字典项信息Repository
 * 移除Spring Data REST注解，改为自定义Controller
 *
 * @author yanyunsong
 */
@Repository
public interface DictionaryItemRepository extends JpaRepository<DbuDictionaryItem, Long>, JpaSpecificationExecutor<DbuDictionaryItem> {
    
    /**
     * 根据字典ID查找所有字典项
     * @param dictId 字典ID
     * @return 字典项列表
     */
    List<DbuDictionaryItem> findByDictionaryId(Long dictId);
    
    /**
     * 根据字典代码查找所有字典项
     * @param dictCode 字典代码
     * @return 字典项列表
     */
    List<DbuDictionaryItem> findByDictionaryDictCode(String dictCode);
}